import Vue from "vue";
import VueRouter from "vue-router";
import Discovery from "../views/Discovery.vue";
import Recommend from "../views/Recommend.vue";
Vue.use(VueRouter);

const routes = [
	{
		path: "/",
		name: "Discovery",
		component: Discovery,
		redirect: "/recommend",
		children: [
			{
				path: "/recommend",
				component: Recommend,
				meta: {
					title: "推荐 - 酷狗音乐",
				},
			},
			{
				path: "/songList",
				component: () =>
					import(
						/* webpackChunkName: "songList" */
						"../views/SongList.vue"
					),
				meta: {
					title: "歌单 - 酷狗音乐",
				},
			},
			{
				path: "/radioStation",
				component: () =>
					import(
						/* webpackChunkName: "radioStation" */
						"../views/RadioStation.vue"
					),
				meta: {
					title: "电台 - 酷狗音乐",
				},
			},
			{
				path: "/listen",
				component: () =>
					import(
						/* webpackChunkName: "listen" */
						"../views/Listen.vue"
					),
				meta: {
					title: "听书 - 酷狗音乐",
				},
			},
			{
				path: "/ranking",
				component: () =>
					import(
						/* webpackChunkName: "ranking" */
						"../views/Ranking.vue"
					),
				meta: {
					title: "排行 - 酷狗音乐",
				},
			},
			{
				path: "/singer",
				component: () =>
					import(
						/* webpackChunkName: "singer" */
						"../views/Singer.vue"
					),
				meta: {
					title: "歌手 - 酷狗音乐",
				},
			},
			{
				path: "/classify",
				component: () =>
					import(
						/* webpackChunkName: "classify" */
						"../views/Classify.vue"
					),
				meta: {
					title: "分类 - 酷狗音乐",
				},
			},
			{
				path: "/video",
				component: () =>
					import(
						/* webpackChunkName: "video" */
						"../views/Video.vue"
					),
				meta: {
					title: "视频 - 酷狗音乐",
				},
			},
			{
				path: "/liveTelecast",
				component: () =>
					import(
						/* webpackChunkName: "liveTelecast" */
						"../views/LiveTelecast.vue"
					),
				meta: {
					title: "直播 - 酷狗音乐",
				},
			},
			{
				path: "/rankingDetails/:rankid",
				component: () =>
					import(
						/* webpackChunkName: "rankingDetails" */
						"../views/RankingDetails.vue"
					),
				meta: {
					title: "排行榜详情 - 酷狗音乐",
				},
			},
			{
				path: "/singerDetails/:singerid",
				component: () => import("../views/SingerDetails.vue"),
				meta: {
					title: "歌手详情 - 酷狗音乐",
				},
			},
			{
				path: "/albumDetails/:albumid",
				component: () => import("../views/AlbumDetails.vue"),
				meta: {
					title: "专辑详情 - 酷狗音乐",
				},
			},
			{
				path: "/VideoDetails/:videohash",
				component: () => import("../views/VideoDetails.vue"),
				meta: {
					title: "视频详情 - 酷狗音乐",
				},
			},
			{
				path: "/songListDetails/:specialid",
				component: () => import("../views/SongListDetails.vue"),
				meta: {
					title: "歌单详情 - 酷狗音乐",
				},
			},
			{
				path: "/classifySongList/:special_tag_id",
				component: () => import("../views/ClassifySongList.vue"),
				meta: {
					title: "专区歌单 - 酷狗音乐",
				},
			},
			{
				path: "/searchDetails/:keywords",
				component: () => import("../views/SearchDetails.vue"),
				meta: {
					title: " 搜索结果- 酷狗音乐",
				},
			},
		],
	},
	{
		path: "/myMusic",
		name: "myMusic",
		component: () => import("../views/MyMusic.vue"),
		redirect: "/myRadioStation",
		children: [
			{
				path: "/myRadioStation",
				component: () => import("../views/MyRadioStation.vue"),
			},
			{
				path: "/download",
				component: () => import("../views/Download.vue"),
			},
			{
				path: "/recently",
				component: () => import("../views/Recently.vue"),
			},
			{
				path: "/default",
				component: () => import("../views/Default.vue"),
			},
		],
	},
];

const router = new VueRouter({
	mode: "history",
	base: process.env.BASE_URL,
	routes,
});
export default router;
